home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / Networking / Talking Heads / Sources / ez_adsp ƒ / ez_adsp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-07  |  2.9 KB  |  83 lines  |  [TEXT/KAHL]

  1. /*
  2.     © 1989 Apple Computer, Inc. by Ricardo Batista
  3.     
  4.                 EZ_ADSP driver interface version 1.0, March 6 1989.
  5.     
  6.     The ez_adsp driver loads itself automatically in any machine, then it loads an
  7.     STR with id 268 to be used as the 'type' registered in the network. STR 269 is
  8.     loaded as the name of a desk accessory to be opened when a connection is
  9.     detected (and the name is not null).  To open the ez_adsp driver issue an
  10.     OpenDriver("\p.ez_adsp",&refNum); call, when you are done with it don't close
  11.     the driver.
  12. */
  13.  
  14.  
  15. /*
  16.     Structure used to give information about a file transfer follows.  The driver
  17.     recognizes a file transfer when two empty messages are sent with the EOM bit
  18.     set and the next message (with the EOM bit set) is the following structure.
  19.     Only the size of the structure is checked and if it matches a file transfer
  20.     is assumed.  Following the file information message is the data fork with the
  21.     EOM bit set at the end, then the resource fork is sent again with the EOM bit
  22.     set at the end.  Notice that if either fork is empty only an EOM bit constitutes
  23.     the message.
  24. */
  25.  
  26.  
  27. typedef struct {
  28.     char    file_name[66];
  29.     OSType     file_creator;
  30.     OSType    file_type;
  31.     long    data_len;
  32.     long    res_len;
  33.     int        finder_flags;
  34.     int        info;
  35. } file_info;
  36.  
  37.                 /* Control call csCode's to the ez_adsp driver */
  38.  
  39.  
  40. #define        openConn            100
  41. #define        closeConn            101
  42. #define        autoFile            102
  43. #define        sendFile            103
  44. #define        disable                104
  45. #define        enable                105
  46. #define        deskFlag            106
  47.  
  48.  
  49.  
  50. /*
  51.     openConn,     opening a connection, csParam[0]-[1] contains an AddrBlock to connect to
  52.     closeConn,     closes a connection and starts waiting for a remote connection if we are
  53.                 enabled to answer a call, default is enabled.
  54.     autoFile,    csParam[0] contains a flag to set the autoFile parameter, if true the
  55.                 driver recognizes a file transfer and saves the received file in the
  56.                 disk the user selects. False by default.
  57.     sendFile,    this takes a pointer to a file name in csParam[0]-[1], and a volume
  58.                 reference number in csParam[2], the file is then transfered to the remote
  59.                 connection.
  60.     disable,    disables answering to a remote connection.
  61.     enable,        enables answering to a remote connection, default.
  62.     deskFlag,    sets the desk accesory opened flag to csParam[0], if false, then as soon
  63.                 as a connection is detected the desk accessory who's name was stored in
  64.                 the resource STR 269 (if any) is opened, then the flag is set to true.
  65. /*
  66.  
  67.  
  68.                 /* Status call csCode's to the ez_adsp driver */
  69.  
  70.  
  71. #define        getBuf                120
  72.  
  73.  
  74. /*
  75.     getBuf,        getBuf returns the number of bytes left to read in csParam[0]-[1],
  76.                 csParam[2] contains the connection state (2 = waiting for a connection,
  77.                 3 = opening a connection, 4 = connection opened, 5 = closing a connection,
  78.                 6 = connection closed and no waiting)
  79.                 csParam[3] conatins the userFlags, csParam[4] the attention code (if any)
  80.                 and csParam[5]-[6] a pointer to the attention data. Normally you will only
  81.                 look at csParam[0]-[1].
  82. */
  83.